<?php
/**
 * AsmCMF
 *
 * @copyright  Copyright &copy; 2008
 * @license    LGPL http://www.gnu.org/copyleft/lesser.html
 * @category Asm_Application
 * @package Asm_Application
 * @author Shandy
 * @version $Id$
 */
class Asm_Application {
	protected $_response;
	
	public function __construct($core){
		if (!($core instanceof Core_Bootstrap)) {
			throw new Asm_Exeption('not valid parametr $core instanceof Core_Bootstrap');
		} 
		$core->bootstrap();
	}
	
	public function bootstrap(){
		$bootstrap = new Bootstrap();
		$bootstrap->init();
	}
	
	public function run(){
		$this->bootstrap();
		$front = Zend_Controller_Front::getInstance();
		$front->returnResponse(true);
		$this->_response = $front->dispatch();
	}
	
	function __destruct(){
		$this->_response->sendResponse();
	}
}
